<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: mtraj</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: mtraj</td>
      <td class="subheader-left"><a href="matlab:open mtraj">View code for mtraj</a></td>
    </tr>
  </table>
<h1>mtraj</h1><p><span class="helptopic">Multi-axis trajectory between two points</span></p><p>
[<strong>q</strong>,<strong>qd</strong>,<strong>qdd</strong>] = <span style="color:red">mtraj</span>(<strong>tfunc</strong>, <strong>q0</strong>, <strong>qf</strong>, <strong>m</strong>) is a multi-axis trajectory (MxN) varying
from configuration <strong>q0</strong> (1xN) to <strong>qf</strong> (1xN) according to the scalar trajectory function
<strong>tfunc</strong> in <strong>m</strong> steps. Joint velocity and acceleration can be optionally returned as
<strong>qd</strong> (MxN) and <strong>qdd</strong> (MxN) respectively.  The trajectory outputs have one row per
time step, and one column per axis.

</p>
<p>
The shape of the trajectory is given by the scalar trajectory function
<strong>tfunc</strong> which is applied to each axis:

</p>
<pre style="width: 90%%;" class="examples">
[S,SD,SDD]&nbsp;=&nbsp;TFUNC(S0,&nbsp;SF,&nbsp;M);
</pre>
<p>
and possible values of <strong>tfunc</strong> include @lspb for a trapezoidal trajectory, or
@tpoly for a polynomial trajectory.

</p>
<p>
[<strong>q</strong>,<strong>qd</strong>,<strong>qdd</strong>] = <span style="color:red">mtraj</span>(<strong>tfunc</strong>, <strong>q0</strong>, <strong>qf</strong>, <strong>T</strong>) as above but <strong>T</strong> (Mx1) is a time
vector which dictates the number of points on the trajectory.

</p>
<h2>Notes</h2>
<ul>
  <li>If no output arguments are specified Q, QD, and QDD are plotted.</li>
  <li>When TFUNC is @tpoly the result is functionally equivalent to JTRAJ except
that no initial velocities can be specified. JTRAJ is computationally a little
more efficient.</li>
</ul>
<h2>See also</h2>
<p>
<a href="jtraj.html">jtraj</a>, <a href="mstraj.html">mstraj</a>, <a href="lspb.html">lspb</a>, <a href="tpoly.html">tpoly</a></p>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2014 Peter Corke.</p>
</body></html>